﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;
using AccessLayer;

namespace BSC.costs
{
    public partial class ucCostImport : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Upload(object sender, DirectEventArgs e)
        {
            //if (!FileUploadField1.HasFile)
            //{
            //    X.Msg.Show(new MessageBoxConfig
            //    {
            //        Buttons = MessageBox.Button.OK,
            //        Icon = MessageBox.Icon.ERROR,
            //        Title = "Fail",
            //        Message = "Vui lòng chọn file chi phí"
            //    });
            //    return;
            //}
            //string path = Server.MapPath(@"~/content/upload/temp/" + FileUploadField1.FileName); 
            //FileUploadField1.PostedFile.SaveAs(path);
            //Import(path,e);
            
        }
        protected void OptimizeCode(object sender, DirectEventArgs e)
        {
            //if (!FileUploadField1.HasFile)
            //{
            //    X.Msg.Show(new MessageBoxConfig
            //    {
            //        Buttons = MessageBox.Button.OK,
            //        Icon = MessageBox.Icon.ERROR,
            //        Title = "Fail",
            //        Message = "Vui lòng chọn file chi phí"
            //    });
            //    return;
            //}
            //string path = Server.MapPath(@"~/content/upload/temp/" + FileUploadField1.FileName);
            //FileUploadField1.PostedFile.SaveAs(path);
            //CostExcelReader dao = new CostExcelReader();
            //dao.Optimize(path, e);

        }

        private void Import(string path,DirectEventArgs e)
        {
            //CostExcelReader dao = new CostExcelReader();
            //dao.Import(path, e);
        }
        
    }
}